package com.aidex.biz.service.impl;

import com.aidex.biz.domain.WorkerList;
import com.aidex.biz.mapper.WorkerListMapper;
import com.aidex.biz.service.WorkerListService;
import com.aidex.common.annotation.DataScope;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.utils.NumberUtils;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 需求工单Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-08-18
 */
@Service
@Transactional(readOnly = true)
public class WorkerListServiceImpl extends BaseServiceImpl<WorkerListMapper, WorkerList> implements WorkerListService
{
    private static final Logger log = LoggerFactory.getLogger(WorkerListServiceImpl.class);

    /**
     * 获取单条数据
     * @param workerList 需求工单
     * @return 需求工单
     */
    @Override
    public WorkerList get(WorkerList workerList)
    {
        WorkerList dto = super.get(workerList);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 需求工单id
     * @return 需求工单
     */
    @Override
    public WorkerList get(String id)
    {
        WorkerList dto = super.get(id);
        return dto;
    }


    /**
     * 查询需求工单列表
     * @param workerList 需求工单
     * @return 需求工单
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<WorkerList> findList(WorkerList workerList)
    {
        return super.findList(workerList);
    }

    /**
     * 分页查询需求工单列表
     * @param workerList 需求工单
     * @return 需求工单
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<WorkerList> findPage(WorkerList workerList)
    {
        return super.findPage(workerList);
    }

    /**
     * 保存需求工单
     * @param workerList
     * @return 结果
     */
    @Override
    public boolean save(WorkerList workerList)
    {
        return super.save(workerList);
    }


    /**
     * 删除需求工单信息
     * @param workerList
     * @return 结果
     */
    @Override
    public boolean remove(WorkerList workerList)
    {
        return super.remove(workerList);
    }

    /**
     * 批量删除需求工单
     * @param ids 需要删除的需求工单ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteWorkerListByIds(String[] ids)
    {
        return mapper.deleteWorkerListByIds(ids);
    }

    /**
     * 获取最大编号
     * @param workerList 需求工单
     * @return 结果
     */
    @Override
    public int findMaxSort(WorkerList workerList)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(workerList));
    }
}
